<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.5.1.js"></script>
    <script>
        $(function () {
            var $tr = $("tr");
            for (var i = 0;i<$tr.length;i++){
                console.log($($tr[i]).attr("id"));
            }

        });

    </script>
</head>
<body>
<table>
    <tr id="aaa">
        <td>1</td>
    </tr>
    <tr>
        <td>2</td>
    </tr>
    <tr>
        <td>3</td>
    </tr>
</table>
</body>
</html>